<template>
  <div class="appContent">
    <queryTable :is-load="isLoad" :form-id="app.SettleFormId" :app-name="app.AppName">
      <el-button slot="btn" size="small" type="success" @click="createFlow(item)">发起流程</el-button>
    </queryTable>
    <createAppAudit :app-id="appId" :visible.sync="visible" />
  </div>
</template>
<script>
import * as appApi from '@/flow/api/flowApp'
import createAppAudit from '@/flow/components/audit/createAppAudit.vue'
import queryTable from '@/customForm/components/queryTable/queryTable.vue'
export default {
  components: {
    createAppAudit,
    queryTable
  },
  data() {
    return {
      app: {},
      appId: null,
      isLoad: false,
      visible: false
    }
  },
  computed: {},
  mounted() {
    this.appId = this.$route.params.id
    this.reset()
  },
  methods: {
    async reset() {
      const res = await appApi.Get(this.appId)
      this.app = res
      this.isLoad = res.SettleFormId != null
    },
    createFlow() {
      this.visible = true
    }
  }
}
</script>
<style scoped>
.appContent {
    padding: 10px;
}
</style>
